<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_blank
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
?>
<?php $_productCollection=$this->getLoadedProductCollection() ?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<div class="category-products">
    <?php //echo $this->getToolbarHtml() ?>

    <?php // List mode ?>
    <?php if($this->getMode()!='grid'): ?>
    <?php $_iterator = 0; ?>
    <div id="carousel-container">
    
    	<div class="previous_button"> &#9664; </div> 
    	<div id="carousel-index" class="total"><span>1 of</span> <?php echo ceil($_productCollection->count()/3); ?></div>
    	<div class="next_button"> &#9654; </div>
 
		      	<div class="container">
				    <ul class="products-list" id="products-list">
				    <?php foreach ($_productCollection as $_product): ?>
				        <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
				            <?php // Product Image ?>
				            
				            <?php // Product description ?>
				            
				                <h2><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
				                
									<span class="product-image">
							            <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(250, 250); ?>" width="250" height="250" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
									</span>
									<span class="product-name"><?php echo $this->htmlEscape($_product->getName())?></span>		
								</a></h2>
								<div class="product-shop">
								<?php /* deactivate review
				                <?php if($_product->getRatingSummary()): ?>
				                <?php echo $this->getReviewsSummaryHtml($_product) ?>
				                <?php endif; ?> */?>
				                <?php //echo $this->getPriceHtml($_product, true) ?>
				                <?php /* deactivate add to cart and desc
				                <?php if($_product->isSaleable()): ?>
				                <p><a href="<?php echo $this->getAddToCartUrl($_product) ?>" class="button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></a></p>
				                <?php else: ?>
				                <p class="availability"><span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span></p>
				                <?php endif; ?>
				                
				                
				                <div class="desc std">
				                    <?php echo nl2br($_product->getShortDescription()) ?>
				                    <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" rel="nofollow"><?php echo $this->__('Learn More') ?></a>
				                </div>*/ ?>
				                <?php /* Deactivate compare and add to wishlists links
				                <ul class="add-to-links">
				                    <?php if ($this->helper('wishlist')->isAllow()) : ?>
				                        <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" rel="nofollow"><?php echo $this->__('Add to Wishlist') ?></a></li>
				                    <?php endif; ?>
				                    <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
				                        <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" rel="nofollow"><?php echo $this->__('Add to Compare') ?></a></li>
				                    <?php endif; ?>
				                </ul>
				                */ ?>
				                
				            </div>
				        </li>
				    <?php endforeach; ?>
				    </ul>
		
				</div>
    </div><!-- /#carousel-container -->

    <?php else: ?>

    <?php // Grid Mode ?>

    <?php $_collectionSize = $_productCollection->count() ?>
    <table class="products-grid" id="products-grid-table">
    <?php $_columnCount = $this->getColumnCount(); ?>
    <?php $i=0; foreach ($_productCollection as $_product): ?>
        <?php if ($i++%$_columnCount==0): ?>
        <tr>
        <?php endif ?>
            <td>
                <h2><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
					<span class="product-image">
						<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
					</span>
					<span class="product-name"><?php echo $this->htmlEscape($_product->getName())?></span>
				</a></h2>
                <?php if($_product->getRatingSummary()): ?>
                <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                <?php endif; ?>
                <?php echo $this->getPriceHtml($_product, true) ?>
                <?php if($_product->isSaleable()): ?>
                <button type="button" class="button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
                <?php else: ?>
                <p class="availability"><span class="out-of-stock"><?php echo $this->__('Out of stock') ?></span></p>
                <?php endif; ?>
                <ul class="add-to-links">
                    <?php if ($this->helper('wishlist')->isAllow()) : ?>
                        <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" rel="nofollow"><?php echo $this->__('Add to Wishlist') ?></a></li>
                    <?php endif; ?>
                    <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                        <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" rel="nofollow"><?php echo $this->__('Add to Compare') ?></a></li>
                    <?php endif; ?>
                </ul>
            </td>
        <?php if ($i%3==0 && $i!=$_collectionSize): ?>
        </tr>
        <?php endif ?>
        <?php endforeach ?>
        <?php for($i;$i%3!=0;$i++): ?>
              <td class="empty">&nbsp;</td>
        <?php endfor ?>
        <?php if ($i%3==0): ?>
        </tr>
        <?php endif ?>
    </table>
    <script type="text/javascript">decorateTable('products-grid-table')</script>
    <?php endif; ?>
    <?php echo "<!--". $this->getToolbarHtml() ."-->" ?>
</div>
<?php endif; ?>
